﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sys_PersonnelManagement.BLL;

namespace Sys_PersonnelManagement.Web
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_Login_Click(object sender, EventArgs e)
        {
            if (ActionDB.Login(txtUserName.Text, txtPasswd.Text))
            {
                //登录成功用Session存用户ID
                Session["UserID"] = ActionDB.UserIdSelect(txtUserName.Text, txtPasswd.Text);
                Response.Redirect("~/Web/Main.aspx");
                
            }
            else
            {
                Response.Write("<script>alert('登录失败')</script>");
            }
        }
    }
}